cssnode: Treat transient nodes as invisible nodes
authorBenjamin Otte <otte@redhat.com>
Fri, 13 Feb 2015 11:44:04 +0000 (12:44 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 18 Mar 2015 14:23:31 +0000 (15:23 +0100)
Making transient nodes invisible allows us to remove special cases
without any bad side effects and they continue working just like they
did before.

gtk/gtkcssnode.c
gtk/gtkcsstransientnode.c

index 5040ff23b1098298d0c6ec87a2b0d6d222b212e0..e59bce84b1df273f3cb3300895b813e02087a1ec 100644 (file)
@@ -20,7 +20,6 @@
 #include "gtkcssnodeprivate.h"
 
 #include "gtkcssanimatedstyleprivate.h"
-#include "gtkcsstransientnodeprivate.h"
 #include "gtkdebug.h"
 #include "gtksettingsprivate.h"
 
@@ -37,9 +36,6 @@ gtk_css_node_set_invalid (GtkCssNode *node,
   if (node->invalid == invalid)
     return;
 
-  if (GTK_IS_CSS_TRANSIENT_NODE (node))
-    return;
-
   node->invalid = invalid;
 
   if (node->parent)
@@ -56,7 +52,6 @@ gtk_css_node_set_invalid (GtkCssNode *node,
     }
 }
 
-
 static void
 gtk_css_node_dispose (GObject *object)
 {
@@ -364,9 +359,6 @@ gtk_css_node_parent_will_be_set (GtkCssNode *node)
 static void
 gtk_css_node_unlink_from_siblings (GtkCssNode *node)
 {
-  if (GTK_IS_CSS_TRANSIENT_NODE (node))
-    return;
-
   if (node->previous_sibling)
     node->previous_sibling->next_sibling = node->next_sibling;
   else
@@ -385,9 +377,6 @@ static void
 gtk_css_node_link_to_siblings (GtkCssNode *node,
                                GtkCssNode *new_previous)
 {
-  if (GTK_IS_CSS_TRANSIENT_NODE (node))
-    return;
-
   if (new_previous)
     {
       node->previous_sibling = new_previous;
index 723c97a4269de203cf6f1719e17175cc6e9897ee..e3d68b414942a6cdef0b201fc6046d7980dba4aa 100644 (file)
@@ -64,6 +64,7 @@ gtk_css_transient_node_class_init (GtkCssTransientNodeClass *klass)
 static void
 gtk_css_transient_node_init (GtkCssTransientNode *cssnode)
 {
+  gtk_css_node_set_visible (GTK_CSS_NODE (cssnode), FALSE);
 }
 
 GtkCssNode *